home *** CD-ROM | disk | FTP | other *** search
- /* The abstract class Shape - it cannot be instantiated */
- abstract class Shape {
-
- abstract public void drawme(); // abstract method
-
- public void printmsg() {
-
- System.out.println("in the abstract class");
- }
-
- }
-
- /* class rectangle - it MUST override drawme() */
- class rectangle extends Shape {
-
- int width, height;
-
- public rectangle(int width,int height) {
- this.width = width;
- this.height = height;
- }
-
- public void drawme() { // overrider
-
- // code to draw a rectangle
-
- }
- }
-
-
-